<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: RSAMMapping Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00189.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">RSAMMapping Class Reference<div class="ingroups"><a class="el" href="a00510.html">phyLayer - physical layer modules</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="RSAMMapping" --><!-- doxytag: inherits="ConstMapping" -->
<p>This class represents the corresponding mapping to a <a class="el" href="a00182.html" title="This special AnalogueModel provides filtering of a Signal according to the actual RadioStates the Rad...">RadioStateAnalogueModel</a> (RSAM).  
 <a href="a00189.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00303_source.html">PhyUtils.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for RSAMMapping:</div>
<div class="dyncontent">
<div class="center"><img src="a00986.png" border="0" usemap="#RSAMMapping_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for RSAMMapping:</div>
<div class="dyncontent">
<div class="center"><img src="a00987.png" border="0" usemap="#RSAMMapping_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00988.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af06c2c7d0de01d46127f12a4d43d3617"></a><!-- doxytag: member="RSAMMapping::RSAMMapping" ref="af06c2c7d0de01d46127f12a4d43d3617" args="(const RSAMMapping &amp;o)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#af06c2c7d0de01d46127f12a4d43d3617">RSAMMapping</a> (const <a class="el" href="a00189.html">RSAMMapping</a> &amp;o)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00189.html">RSAMMapping</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#afd82b76846eaeea2ac5ac06255770258">operator=</a> (const <a class="el" href="a00189.html">RSAMMapping</a> &amp;copy)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">RSAMMapping assignment operator.  <a href="#afd82b76846eaeea2ac5ac06255770258"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#a61ee1608b52cd975bffe1350f468a4cb">swap</a> (<a class="el" href="a00189.html">RSAMMapping</a> &amp;s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Swaps data with another RSAMMapping.  <a href="#a61ee1608b52cd975bffe1350f468a4cb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acec9b66637a97c81d45a073f622bf9ee"></a><!-- doxytag: member="RSAMMapping::RSAMMapping" ref="acec9b66637a97c81d45a073f622bf9ee" args="(const RadioStateAnalogueModel *rsam, simtime_t_cref signalStart, simtime_t_cref signalEnd)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#acec9b66637a97c81d45a073f622bf9ee">RSAMMapping</a> (const <a class="el" href="a00182.html">RadioStateAnalogueModel</a> *<a class="el" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92">rsam</a>, simtime_t_cref <a class="el" href="a00189.html#a83073d619992a38be77157eeaa8de677">signalStart</a>, simtime_t_cref <a class="el" href="a00189.html#ac4a1ed01e6319d66ada6b7bab12ce93f">signalEnd</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor taking a pointer to the corresponding RSAM. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual argument_value_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#adfde2753ba641cbdafbd95fc914034e6">getValue</a> (const <a class="el" href="a00013.html">Argument</a> &amp;pos) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of this Function at position specified by the passed <a class="el" href="a00013.html" title="Defines an argument for a mapping.">Argument</a>. Zero-time-switches are ignored here, i.e. in case of multiple entries at the same time-point, the last one is significant.  <a href="#adfde2753ba641cbdafbd95fc914034e6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c4471fe51b34fab8f93b644326c1862"></a><!-- doxytag: member="RSAMMapping::createConstIterator" ref="a0c4471fe51b34fab8f93b644326c1862" args="() const " -->
virtual <a class="el" href="a00059.html">ConstMappingIterator</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#a0c4471fe51b34fab8f93b644326c1862">createConstIterator</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer of a new Iterator which is able to iterate over the function. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a79e3de9b0f3220b01dd28346e51ae019"></a><!-- doxytag: member="RSAMMapping::createConstIterator" ref="a79e3de9b0f3220b01dd28346e51ae019" args="(const Argument &amp;pos) const " -->
virtual <a class="el" href="a00059.html">ConstMappingIterator</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#a79e3de9b0f3220b01dd28346e51ae019">createConstIterator</a> (const <a class="el" href="a00013.html">Argument</a> &amp;pos) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer of a new Iterator which is able to iterate over the function. The iterator starts at the passed position. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7b47c38b2b2c98e251db268c9fe4ce6d"></a><!-- doxytag: member="RSAMMapping::constClone" ref="a7b47c38b2b2c98e251db268c9fe4ce6d" args="() const " -->
virtual <a class="el" href="a00058.html">ConstMapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#a7b47c38b2b2c98e251db268c9fe4ce6d">constClone</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns a deep copy of this mapping instance. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e968e40c9c6d55ef033aea16dc7cc92"></a><!-- doxytag: member="RSAMMapping::rsam" ref="a1e968e40c9c6d55ef033aea16dc7cc92" args="" -->
const <a class="el" href="a00182.html">RadioStateAnalogueModel</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92">rsam</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to the RSAM module. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83073d619992a38be77157eeaa8de677"></a><!-- doxytag: member="RSAMMapping::signalStart" ref="a83073d619992a38be77157eeaa8de677" args="" -->
simtime_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#a83073d619992a38be77157eeaa8de677">signalStart</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start of the signal this mapping defines attenuation for. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac4a1ed01e6319d66ada6b7bab12ce93f"></a><!-- doxytag: member="RSAMMapping::signalEnd" ref="ac4a1ed01e6319d66ada6b7bab12ce93f" args="" -->
simtime_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00189.html#ac4a1ed01e6319d66ada6b7bab12ce93f">signalEnd</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">End of the signal this mapping defines attenuation for. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class represents the corresponding mapping to a <a class="el" href="a00182.html" title="This special AnalogueModel provides filtering of a Signal according to the actual RadioStates the Rad...">RadioStateAnalogueModel</a> (RSAM). </p>
<p>Since RSAM is modified dynamically over time, <a class="el" href="a00189.html" title="This class represents the corresponding mapping to a RadioStateAnalogueModel (RSAM).">RSAMMapping</a> doesn't store the information itself, but interacts with its RSAM to obtain information about the mapping.</p>
<p>The relation to RSAM is very tight. RSAM creates an appropriate <a class="el" href="a00189.html" title="This class represents the corresponding mapping to a RadioStateAnalogueModel (RSAM).">RSAMMapping</a> by passing a self-pointer to the constructor call.</p>
<p>class <a class="el" href="a00189.html" title="This class represents the corresponding mapping to a RadioStateAnalogueModel (RSAM).">RSAMMapping</a> is a friend of class <a class="el" href="a00182.html" title="This special AnalogueModel provides filtering of a Signal according to the actual RadioStates the Rad...">RadioStateAnalogueModel</a> </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="adfde2753ba641cbdafbd95fc914034e6"></a><!-- doxytag: member="RSAMMapping::getValue" ref="adfde2753ba641cbdafbd95fc914034e6" args="(const Argument &amp;pos) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RSAMMapping::argument_value_t RSAMMapping::getValue </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00013.html">Argument</a> &amp;&#160;</td>
          <td class="paramname"><em>pos</em></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the value of this Function at position specified by the passed <a class="el" href="a00013.html" title="Defines an argument for a mapping.">Argument</a>. Zero-time-switches are ignored here, i.e. in case of multiple entries at the same time-point, the last one is significant. </p>
<p>In this case we have a function: simtime_t -&gt; attenuation </p>

<p>Implements <a class="el" href="a00058.html#afabbd15bb8f50e45901f99633d0a47c9">ConstMapping</a>.</p>

<p>References <a class="el" href="a00013.html#a2ecb3b041b5b8721d6767531e4ac792a">Argument::getTime()</a>, <a class="el" href="a00182.html#a85a93fd7827eb98707f472d31e5c6fd4">RadioStateAnalogueModel::radioStateAttenuation</a>, and <a class="el" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92">rsam</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="comment">// extract the time-component from the argument</span>
  simtime_t_cref t = pos.<a class="code" href="a00013.html#a2ecb3b041b5b8721d6767531e4ac792a" title="Returns the time value of this argument.">getTime</a>();

  <span class="comment">// assert that t is not before the first timepoint in the RSAM</span>
  <span class="comment">// and receiving list is not empty</span>
  assert( !(<a class="code" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92" title="Pointer to the RSAM module.">rsam</a>-&gt;<a class="code" href="a00182.html#a85a93fd7827eb98707f472d31e5c6fd4" title="Data structure to track the Radios attenuation over time.">radioStateAttenuation</a>.empty()) &amp;&amp;
      !(t &lt; rsam-&gt;radioStateAttenuation.front().getTime()) );

  <span class="comment">/* receiving list contains at least one entry */</span>

  <span class="comment">// set an iterator to the first entry with timepoint &gt; t</span>
  RadioStateAnalogueModel::time_attenuation_collection_type::const_iterator it;
  it = upper_bound(<a class="code" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92" title="Pointer to the RSAM module.">rsam</a>-&gt;<a class="code" href="a00182.html#a85a93fd7827eb98707f472d31e5c6fd4" title="Data structure to track the Radios attenuation over time.">radioStateAttenuation</a>.begin(), <a class="code" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92" title="Pointer to the RSAM module.">rsam</a>-&gt;<a class="code" href="a00182.html#a85a93fd7827eb98707f472d31e5c6fd4" title="Data structure to track the Radios attenuation over time.">radioStateAttenuation</a>.end(), t);

  <span class="comment">// REGULAR CASE: it points to an element that has a predecessor</span>
  --it; <span class="comment">// go back one entry, this one is significant!</span>

  <span class="keywordflow">return</span> it-&gt;getValue();
}
</pre></div>
</div>
</div>
<a class="anchor" id="afd82b76846eaeea2ac5ac06255770258"></a><!-- doxytag: member="RSAMMapping::operator=" ref="afd82b76846eaeea2ac5ac06255770258" args="(const RSAMMapping &amp;copy)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00189.html">RSAMMapping</a>&amp; RSAMMapping::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00189.html">RSAMMapping</a> &amp;&#160;</td>
          <td class="paramname"><em>copy</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>RSAMMapping assignment operator. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">copy</td><td>A RSAMMapping of identical element and allocator types.</td></tr>
  </table>
  </dd>
</dl>
<p>All the elements of <em>copy</em> are copied. </p>

<p>References <a class="el" href="a00058.html#a473df8fa0aa441ca1adb356b17b1f59f">ConstMapping::swap()</a>.</p>
<div class="fragment"><pre class="fragment">                                                  {
    <a class="code" href="a00189.html" title="This class represents the corresponding mapping to a RadioStateAnalogueModel (RSAM).">RSAMMapping</a> tmp(copy);

    <a class="code" href="a00189.html#a61ee1608b52cd975bffe1350f468a4cb" title="Swaps data with another RSAMMapping.">swap</a>(tmp);
    <span class="keywordflow">return</span> *<span class="keyword">this</span>;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="a61ee1608b52cd975bffe1350f468a4cb"></a><!-- doxytag: member="RSAMMapping::swap" ref="a61ee1608b52cd975bffe1350f468a4cb" args="(RSAMMapping &amp;s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RSAMMapping::swap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00189.html">RSAMMapping</a> &amp;&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Swaps data with another RSAMMapping. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>A RSAMMapping of the same element and allocator types.</td></tr>
  </table>
  </dd>
</dl>
<p>This exchanges the elements between two RSAMMapping's in constant time. Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function. </p>

<p>References <a class="el" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92">rsam</a>, <a class="el" href="a00189.html#ac4a1ed01e6319d66ada6b7bab12ce93f">signalEnd</a>, <a class="el" href="a00189.html#a83073d619992a38be77157eeaa8de677">signalStart</a>, and <a class="el" href="a00058.html#a473df8fa0aa441ca1adb356b17b1f59f">ConstMapping::swap()</a>.</p>
<div class="fragment"><pre class="fragment">                            {
    <a class="code" href="a00189.html#a61ee1608b52cd975bffe1350f468a4cb" title="Swaps data with another RSAMMapping.">ConstMapping::swap</a>(s);
    <a class="code" href="a00189.html#a61ee1608b52cd975bffe1350f468a4cb" title="Swaps data with another RSAMMapping.">std::swap</a>(<a class="code" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92" title="Pointer to the RSAM module.">rsam</a>,        s.<a class="code" href="a00189.html#a1e968e40c9c6d55ef033aea16dc7cc92" title="Pointer to the RSAM module.">rsam</a>);
    <a class="code" href="a00189.html#a61ee1608b52cd975bffe1350f468a4cb" title="Swaps data with another RSAMMapping.">std::swap</a>(<a class="code" href="a00189.html#a83073d619992a38be77157eeaa8de677" title="Start of the signal this mapping defines attenuation for.">signalStart</a>, s.<a class="code" href="a00189.html#a83073d619992a38be77157eeaa8de677" title="Start of the signal this mapping defines attenuation for.">signalStart</a>);
    <a class="code" href="a00189.html#a61ee1608b52cd975bffe1350f468a4cb" title="Swaps data with another RSAMMapping.">std::swap</a>(<a class="code" href="a00189.html#ac4a1ed01e6319d66ada6b7bab12ce93f" title="End of the signal this mapping defines attenuation for.">signalEnd</a>,   s.<a class="code" href="a00189.html#ac4a1ed01e6319d66ada6b7bab12ce93f" title="End of the signal this mapping defines attenuation for.">signalEnd</a>);
  }
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/phyLayer/<a class="el" href="a00303_source.html">PhyUtils.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/phyLayer/PhyUtils.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00189.html">RSAMMapping</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:33 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
